package Models

type GZConfig struct { // 默认操作的是这张表的复数
	Id          int64  `json:"id" gorm:"primary_key"`
	Name        string `json:"config_key" gorm:"size:50"`
	ConfigValue string `json:"config_value" gorm:"type:text"`
	ConfigTabId int    `json:"config_tab_id" gorm:"size:10"`
	Typee       int    `json:"type" gorm:"column:type; size:255"`
	Parameter   string `json:"parameter" gorm:"size:255"`
	UploadType  int32  `json:"upload_type" gorm:"size:1"`
	Info        string `json:"info" gorm:"size:1"`
	Remark      string `json:"remark" gorm:"size:1"`
	Orderby     int64  `json:"orderby"`
	Closed      int64  `json:"closed"`
	CreatedAt   int64  `json:"create_time"`
	UpdatedAt   int64  `json:"update_time"`
	Rquired     int32  `json:"required" gorm:"size:255"`
}

func (GZConfig) TableName() string {
	return "gz_config"
}

type ByColumn struct {
	ConfigValue string
}

func GetValueByColumn(clu string) ByColumn {
	cfg := ByColumn{}
	field := "config_value"
	DB.Table("gz_config").Where("config_key = ?", clu).Select(field).Find(&cfg)
	return cfg
}
